<!DOCTYPE html>

<%@page import="javax.swing.JOptionPane"%>
<%@page import="com.huellas.bean.ListadoCitasComprobanteBean"%>
<%@page import="java.util.ArrayList"%>
<%@page import="java.util.Collection"%>
<html lang="es">
<head>
<meta charset="UTF-8">
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Citas Disponibles para Generar Comprobante</title>
</head>
<body >
<jsp:include page="header.jsp"></jsp:include>
<table>
	<tr>
		<td></td>

	</tr>
	<tr>
		<td align="center" width="1200">
			<h3>Seleccion de Cita a Cancelar</h3>
		</td>
	</tr>
</table>	
<form id="form2" name="form2" method="post" action="ListadoCitaComprobanteServlet" >
<table>
	<tr>
		<td align="center" width="1200">
			<table>
				<tr>
					<td>Criterio Busqueda </td>
					<td>: </td>
					<td>
						<select id="OpcCriterio" name="OpcCriterio">
					 		<option value="T" >Todas</option>
					 		<option value="C" >Cod.Cliente</option>
					 		<option value="N" >Cod. Cita</option>
					 	</select>
					 </td>
					<td> <input type="number" id="txtCodigo" name="txtCodigo" value="0"> </td>
					<td colspan="4"> <input type="submit" value="Consultar"> </td>
				</tr>
			</table>
		</td> 
	</tr>
</table>
</form>
<table>
	<tr>
		<td align="center" width="1200">		
		<table border="1">
			<tr align="center">
					<th width="65" scope="col">Cita</th>
					<th width="65" scope="col">Fecha</th>
					<th width="65" scope="col">Hora</th>
					<th width="50" scope="col">Cod. <br>Paciente</th>
					<th width="200" scope="col">Paciente</th>
					<th width="50" scope="col">Cod. <br>Cliente</th>
					<th width="200" scope="col">Cliente</th>
					<th width="50" scope="col">Cod. <br>Doctor</th>
					<th width="200" scope="col">Doctor</th>
					<th width="50" scope="col">Estado Cita</th>
					<th width="80" scope="col">Opciones</th>
			</tr>
		<%
			Collection<ListadoCitasComprobanteBean> ListaCitas =  (ArrayList<ListadoCitasComprobanteBean>)request.getAttribute("ListaCitasParaComprobantes");
			//JOptionPane.showMessageDialog(null, ListaCitasComprobante.size());
			if(ListaCitas != null){
			for(ListadoCitasComprobanteBean a: ListaCitas){
			//JOptionPane.showMessageDialog(null, a.getNomPaciente());
			%>	
					<tr align="center">
						<td> <% out.print(a.getCita()); %> </td>
						<td> <% out.print(a.getFecha()); %> </td>
						<td> <% out.print(a.getHora()); %> </td>
						<td> <% out.print(a.getCodPaciente()); %> </td>
						<td> <% out.print(a.getNomPaciente()); %> </td>
						<td> <% out.print(a.getCodCliente()); %> </td>
						<td> <% out.print(a.getNomCliente()); %> </td>
						<td> <% out.print(a.getCodDoctor()); %> </td>
						<td> <% out.print(a.getNomDoctor()); %> </td>
						<td> <% out.print(a.getEstadoComprobante()); %> </td>
						<% // if (a.getEstadoComprobante().equalsIgnoreCase("Anulado") || a.getEstadoComprobante().equalsIgnoreCase("Generar") ){ %>
						<td><a href="PrevieCitaPagarServlet?CodCita=<%=a.getCita() %>">Vista Previa</a> </td>
						<% //} %>
					</tr>
		<%	}} %>
		
		</table>
	</td></tr>
</table>		
<table>
<tr align="center">
			<td> <input type="button" value="Regresar" onclick="window.location='ComprobantePago.jsp' "> </td>
		</tr>
</table>

</body>
</html>